package com.oms.app.address.service;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.oms.app.address.model.Address;
import com.oms.core.service.IGeneralService;

/**
 * @author Loong_Mit
 * @date Sep 1, 2012 6:30:14 PM
 */

public interface IAddressService extends IGeneralService<Address, String> {
	
	/**
	 * 获取地址列表
	 * @param request
	 * @return
	 * Administrator
	 */
	public List<Address> getAddressList(HttpServletRequest request);
	/**
	 * 增加地址信息
	 * @param address
	 * @return
	 * Administrator
	 */
	public boolean addAddress(Address address);
	
	/**
	 * 更新地址信息
	 * @param address
	 * @return
	 * Administrator
	 */
	public boolean updateAddress(Address address);
	
	/**
	 * 删除地址信息
	 * @param PK
	 * @return
	 * Administrator
	 */
	public boolean deleteAddress(String PK);
	
	/**
	 * 通过主键取得地址信息
	 * @param PK
	 * @return
	 * Administrator
	 */
	public Address getAddressByPK(String PK);
	
	/**
	 * 保存 用户/商家 地址关系信息
	 * @return
	 */
	public boolean saveAddressRelation(Map<String, Object> map);
	
	/**
	 * 根据条件删除 商家/地址/用户 地址关系表
	 * @param map
	 * @return
	 */
	public boolean deleteAddressRelation(Map<String, Object> map);
	
	/**
	 * 通过父ID查找子地址集合
	 * @param parentId
	 * @return
	 * Administrator
	 */
	public List<Address> getAddressByParentId(String parentId);
}
